﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;
using ZJF.InterfaceReflection._1.接口反射;
using ZJF.InterfaceReflection._2.反射工厂类;

namespace ZJF.InterfaceReflection
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Test1();
            Test2();
            Console.ReadLine();
        }


        static void Test1() {
            Car audi = new Audi("奥迪", "good car");
            audi.Run();
            try {
                var tag = (Car)Assembly.Load("ZJF.InterfaceReflection").CreateInstance("ZJF.InterfaceReflection._1.接口反射.Audi");
                tag.Name = "奥迪111";
                tag.Description = "good car !!!!!";
                tag.Run();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            
        }

        static void Test2() {
            var obj = ObjectFactory.GetObject();
            obj.Name = "奥迪汽车";
            obj.Run();
        }
    }
}
